package com.exam.serviceimpl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.exam.entity.Evaluation;
import com.exam.entity.TestResult;
import com.exam.mapper.EvaluationMapper;
import com.exam.service.EvaluationService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Description:
 * @Company：
 * @Author:
 * @Date: 2022/5/1 17:06
 * @Version 1.0
 */
@Service
public class EvaluationServiceImpl implements EvaluationService {
    @Resource
    private EvaluationMapper evaluationMapper;

    @Override
    public Integer add(Evaluation evaluation) {
        return evaluationMapper.add(evaluation);
    }

    @Override
    public Integer addResult(TestResult testResult) {
        return evaluationMapper.addResult(testResult);
    }

    @Override
    public Integer get(TestResult testResult) {
        return evaluationMapper.get(testResult);
    }

    @Override
    public Integer updateResult(TestResult testResult) {
        return evaluationMapper.updateResult(testResult);
    }

    @Override
    public Evaluation findById(Integer id) {
        return evaluationMapper.findById(id);
    }

    @Override
    public List<TestResult> findAnswer(Integer id, Integer paperId,Integer type) {
        return evaluationMapper.findAnswer(id,paperId,type);
    }

    @Override
    public IPage<Evaluation> findAll(Page<Evaluation> teacherPage, Integer userId, String teacherName,String source) {
        return evaluationMapper.findAll(teacherPage,userId,teacherName,source);
    }
}
